package com.amumu.netctoss.action;

import java.util.Map;

import org.apache.struts2.interceptor.RequestAware;
import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class BaseAction extends ActionSupport implements SessionAware,
		RequestAware {
	//每页显示大小
	public static final int PAGE_SIZE = 5;
	protected Map<String, Object> session;
	protected Map<String, Object> request;
	//当前页
	protected int page = 1;
	//总页数
	protected int pageCount;
	//实体id
	protected int id;
	//操作结果
	protected boolean ok;

	public boolean isOk() {
		return ok;
	}

	public void setOk(boolean ok) {
		this.ok = ok;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getPageCount() {
		return pageCount;
	}

	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
		page = page > pageCount ? pageCount : page;
		page = page > 0 ? page : 1;
	}

	public void setSession(Map<String, Object> arg0) {
		this.session = arg0;
	}

	public void setRequest(Map<String, Object> arg0) {
		this.request = arg0;
	}

}
